package com.raycloud.dingtalk.starter.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fay  fay9395@gmail.com
 * @date 2019-07-22 09:51.
 */
@Data
public class DingTalkResp {
    private String msgtype = "text";
    private DingTalkReq.DingTalkText text;
    private DingTalkAt at;
    private Boolean isAtAll;


    @Data
    public static class DingTalkAt {
        private List<String> atMobiles;
        private List<String> atDingtalkIds;

        public DingTalkAt addDingTalkAd(String id) {
            if (atDingtalkIds == null) {
                atDingtalkIds = new ArrayList<>();
            }
            atDingtalkIds.add(id);
            return this;
        }
    }
}
